<template>
 <div class="container" >
    <div :class="['color']">双击666!</div>
    <div :class="['color',italic?'italic':'']">双击666!</div>
    <button @click="italicbtn">点击</button>
    <div :class="{color:true,italic}">双击666!</div>
 </div>
</template>
<script>
 export default {
 name: '',
 data: function(){
 return {
    italic:true
 }
 },
 methods:{
    italicbtn(){
       if(this.italic){
        this.italic=false;
       }else{
        this.italic = true;
       }
    }
 }
 }
</script>
<style>
html,
 body, 
 #app{
 height: 100%;
 }
</style>
<style scoped>
 .container {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 width: 100%;
 height: 100%;
 background-color: aliceblue;
 }
 .tr{
 width: 200px;
 flex-basis: 50px;
 display: flex;
 flex-direction: row;
 justify-content: space-between;
 background-color: beige;
 align-items: center;
 }
 .second{
 background-color: aqua;
 }
 .color{
    background-color: #d11616;
 }
 .italic{
    font-style: italic;
 }
</style>